package hadoop.ch03.v17024410134;
import org.apache.hadoop.conf.*;
import org.apache.hadoop.fs.*;

import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;

public class PassHDFSFile {
    public static void main(String[] args) throws Exception{
        Configuration conf = new Configuration();
        URI uri = new URI("hdfs://192.168.30.131:8020");




        FileSystem fs = FileSystem.get(uri, conf, "hadoop");

        Path src = new Path("D:\\test.txt");
        Path dst = new Path("/17024410134/test.txt");
        fs.copyFromLocalFile(src,dst);
        fs.close();
        System.out.println("成功");

    }



}
